package com.tanhua.vo;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * 定义异常返回结果
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Builder
public class ErrorResult {

    private String errCode ;
    private String errMsg;

    public static ErrorResult error(){
        return ErrorResult.builder().errCode("999999").errMsg("系统异常").build();
    }

    public static ErrorResult codeNotExistError(){
        return ErrorResult.builder().errCode("000001").errMsg("redis不存在验证码").build();
    }
    public static ErrorResult codeError(){
        return ErrorResult.builder().errCode("000002").errMsg("验证码错误").build();
    }
    public static ErrorResult loginError(){
        return ErrorResult.builder().errCode("000003").errMsg("登录失败").build();
    }
    public static ErrorResult faceError(){
        return ErrorResult.builder().errCode("000004").errMsg("人脸检测异常").build();
    }

}
